<?php

use think\migration\Migrator;
use think\migration\db\Column;

class InterfaceUserToken extends Migrator
{
    /**
     * 接口的Token值
     */
    public function change()
    {
        $table = $this->table('interface_user_token');
        $table
            //step1:名称
            ->addColumn('type', 'string', ['limit' => 20, 'comment' => '类型,1tsinghua（清华）'])
            ->addColumn('name', 'string', ['limit' => 20, 'comment' => '类型,1清华'])

            //token和有效期
            ->addColumn('token', 'string', ['limit' => 36, 'comment' => 'token值'])
            ->addColumn('expiry_time', 'integer', ['limit' => 11, 'comment' => '有效期'])
            ->addColumn('create_time', 'integer', ['limit' => 11, 'comment' => '创建时间'])

            //备注
            ->addColumn('memo', 'text', ['comment' => '详细说明'])
            //注释
            ->setComment('接口 - 用户token表')
            //引擎
            ->setEngine('InnoDB')
            ->save();
    }
}
